package model.board;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ibatis.sqlmap.client.SqlMapClient;


public class NoticeBoardDao {
	private SqlMapClient sqlMapClient;

	public NoticeBoardDao() {
		super();
	}

	public NoticeBoardDao(SqlMapClient sqlMapClient) {
		super();
		this.sqlMapClient = sqlMapClient;
	}
	public String getDate() throws SQLException{
		return (String) sqlMapClient.queryForObject("noticeBoard.getDate");
	}
	public void noticeWrite(NoticeBoardVO vo) throws SQLException{
		sqlMapClient.insert("noticeBoard.noticeWrite", vo);
	}

	public List noticeAllList(HashMap map) throws SQLException {
		return sqlMapClient.queryForList("noticeBoard.noticeAllList", map);
	}
	public int noticeAllContentNO() throws SQLException{
		return (Integer) sqlMapClient.queryForObject("noticeBoard.noticeAllContentNO");
	}
	public HashMap noticeShowContent(int b_no) throws SQLException{
		return (HashMap) sqlMapClient.queryForObject("noticeBoard.noticeShowContent", b_no);
	}

	public void noticeContentCnt(int cnt) throws SQLException {
		sqlMapClient.update("noticeBoard.noticeContentCnt", cnt);
	}

	public void noticeDelete(int b_no) throws SQLException {
		sqlMapClient.delete("noticeBoard.noticeDelete", b_no);
		
	}

	public Map noticeUpdatePage(int b_no) throws SQLException {
		return (Map) sqlMapClient.queryForObject("noticeBoard.noticeUpdatePage", b_no);
		
	}

	public void noticeUpdate(NoticeBoardVO vo) throws SQLException {
		sqlMapClient.update("noticeBoard.noticeUpdate", vo);
		
	}

	
}
